package com.ushine.web.component.validation.rule;


import com.ushine.web.component.validation.annotation.Gender;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * <h3>性别验证</h3>
 *
 * @Author: 邱鹏
 * @Date 2021-01-14 14:37
 * @CompileVersion 1.8
 * @Version 1.0
 */
public class GenderValidator implements ConstraintValidator<Gender, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return "男".equals(s) || "女".equals(s);
    }

}
